home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Programming / jpeg.lib / usr / Install-jpeglibrary < prev    next >
Encoding:
Text File  |  2001-01-03  |  4.4 KB  |  198 lines

  1. ; Install jpeg.library
  2. ; $VER: Install-jpeglibrary V1.0 (20.8.2000)
  3. ; © 2000 Paul Huxham
  4.  
  5. (set #catalog 0) ; english language is default
  6.  
  7. ; Find the current language
  8. (set #i 0)
  9. (while (set #thisfile (select #i
  10.         "english" "italiano" "deutsch" "español" "czech" "català" "dansk" "français"
  11.         "hrvatski" "nederlands" "norsk" "polski" "português"
  12.         "russian" "srpski" "suomi" "svenska" "ÃeÓtina"
  13.         ""))
  14.     (
  15.         (if (= @language #thisfile)
  16.             (
  17.                 (set #catalog #i)
  18.                 (set #catalogname #thisfile)
  19.             )
  20.         )
  21.         (set #i (+ #i 1))
  22.     )
  23. )
  24.  
  25. (set #catalog "English")
  26.  
  27. ; Reset #catalogname as the user may have changed the language above
  28. (if (< #catalog 5)
  29.     (
  30.         (set #catalogname (select #catalog "english" "italiano" "deutsch" "español" "czech"))
  31.     )
  32. )
  33.  
  34. ; Some string defaults common for all languages
  35. (set #HOMEPAGE "http://mafeking.scouts.org.au/steeplesoftware")
  36. (set #BLANK "\n")
  37.  
  38.  
  39. ; ************************** English texts ******************************
  40. (set #INITIAL_MESSAGE
  41.   (cat "\nWelcome to the jpeg.library installer\n\n\n"
  42.     "You can obtain updates and other information\nabout jpeg.library from the homepage\n\n"
  43.     #HOMEPAGE)
  44. )
  45. (set #WRONG_INSTALLER_VERSION "\n\n\n\nYou need at least version 42.9 of Installer\nto install jpeg.library")
  46. (set #WRONG_CPU "\n\n\n\nYou need a 68020 CPU or better\nto use jpeg.library")
  47. (set #WRONG_OS_VERSION "\n\n\n\nYou need at least AmigaOS V2.0\nto use jpeg.library")
  48. (set #INSTALLING "\nInstalling")
  49. (set #PROMPT_INSTALL_PPC "Install PPC (WarpOS) version?")
  50. (set #INSTALL_WHICH_VERSION "\nInstall version for which CPU?")
  51. (set #PROMPT_INSTALL_JPEGPREFS "\nInstall jpeg.library prefs?")
  52. (set #INSTALLING_JPEGPREFS "\nInstalling jpeg.library prefs")
  53. (set #UPDATES_AVAILABLE "\nYou can get the latest version\nof jpeg.library from my home page")
  54. (set #YES "Yes")
  55. (set #NO "No")
  56.  
  57.  
  58. ; ************************* Global procedures ***************************
  59. (procedure P_copylib lib destpath newlibname
  60.     (
  61.         (copylib
  62.             (prompt (cat (cat #INSTALLING " ") (fileonly newlibname)))
  63.             (help @copylib-help)
  64.             (newname newlibname)
  65.             (source lib)
  66.             (dest destpath)
  67.             (confirm)
  68.             (optional askuser force)
  69.         )
  70.     )
  71. )
  72.  
  73.  
  74. ; *********************** jpeg.library install
  75.  
  76. (if (< @installer-version (+ (* 65536 42) 9))
  77.     (abort #WRONG_INSTALLER_VERSION)
  78. )
  79.  
  80. (if (< (database "cpu") 68020 )
  81.     (abort #WRONG_CPU)
  82. )
  83.  
  84. (set os_version (/ (getversion "exec.library" (resident)) 65536))
  85. (if (< os_version 37)
  86.     (abort #WRONG_OS_VERSION)
  87. )
  88.  
  89. ; All essential version numbers are correct, continue installation
  90. (message #INITIAL_MESSAGE)
  91.  
  92. (complete 0)
  93.  
  94.  
  95. ; *********************** Sort out what the user has where
  96.  
  97. ; Establish CPU type
  98.  
  99. (set #ourcpu (database "cpu"))
  100.  
  101. (if (= #ourcpu "68020") (set #ourcpu 0))
  102. (if (= #ourcpu "68030") (set #ourcpu 0))
  103. (if (= #ourcpu "68040") (set #ourcpu 2))
  104. (if (= #ourcpu "68060") (set #ourcpu 4))
  105.  
  106. (complete 0)
  107.  
  108.  
  109. ; *********************** Install jpeg.library
  110.  
  111. ; *********************** Is WarpOS installed
  112. (set #ppc 1) ; No PPC by default
  113.  
  114. (set warpos_version 0)
  115. (set warpos_version (getversion "warpos.library" ))
  116. (if (> warpos_version 0)
  117.     (
  118.         (set #ppc 0)
  119.  
  120.         (set #ppc
  121.             (askchoice
  122.                 (help @askchoice-help)
  123.                 (prompt #PROMPT_INSTALL_PPC)
  124.                 (choices #YES #NO)
  125.                 (default #ppc)
  126.             )
  127.         )
  128.     )
  129. )
  130.  
  131. (if (= #ppc 1)
  132.     (set #cpu_install
  133.         (askchoice
  134.             (help @askchoice-help)
  135.             (prompt #INSTALL_WHICH_VERSION)
  136.             (choices "68020" "68020/68881" "68040" "68040/68881" "68060" "68060/68881")
  137.             (default #ourcpu)
  138.         )
  139.     )
  140. )
  141.  
  142. (set @default-dest "Libs:")
  143.  
  144. (if (= @user-level 2) ;If expert user, ask directory
  145.     (
  146.         (set @default-dest
  147.             (askdir
  148.                 (prompt #SELECT_INSTALL_DIRECTORY)
  149.                 (help @askdir-help)
  150.                 (default @default-dest)
  151.             )
  152.         )
  153.     )
  154. )
  155.  
  156. (if (= #ppc 0)
  157.     (
  158.         ; PPC installed
  159.         (P_copylib "libs/jpeg.library_wos" @default-dest "jpeg.library")
  160.     )
  161.     (
  162.         (set #entry (select #cpu_install "020std" "020881" "040std" "040881" "060std" "060881" ""))
  163.         (set #entry (cat "libs/jpeg.library_" #entry))
  164.  
  165.         (P_copylib #entry @default-dest "jpeg.library")
  166.     )
  167. )
  168.  
  169.  
  170. (complete 80)
  171. (if (=
  172.     (askchoice
  173.         (help @askchoice-help)
  174.         (prompt #PROMPT_INSTALL_JPEGPREFS)
  175.         (choices #YES #NO)
  176.         (default 0)
  177.     )    0 )
  178.     (
  179.         (copyfiles
  180.             (prompt #INSTALLING_JPEGPREFS)
  181.             (source "prefs")
  182.             (choices "JpegLibraryPrefs" "JpegLibraryPrefs.info" )
  183.         (help @copyfiles-help)
  184.             (dest @default-dest)
  185.             (files)
  186.             (noposition)
  187.             (optional askuser)
  188.             (confirm)
  189.         )
  190.     )
  191. )
  192.  
  193. (complete 100)
  194.  
  195. ; *********************** Finished installation
  196.  
  197. (message (cat #UPDATES_AVAILABLE #BLANK #BLANK #HOMEPAGE))
  198.